#ifndef __MAIN_H
#define __MAIN_H

#include "py32f0xx_hal.h"

#define _offsetof(TYPE, MEMBER) ((size_t) &((TYPE*)0)->MEMBER)
#define container_of(ptr, type, member) ({                      \
const typeof( ((type *)0)->member ) *__mptr = (ptr);            \
(type *)( (char *)__mptr - _offsetof(type,member) );})

#endif

